<!-- eslint-disable vue/multi-word-component-names -->
<template>
  <div class="ms-nav indexpage">
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span>皮带机监控页面</span>
      </div>
      <centreTable :tableData="tableData" @handle="handle"></centreTable>
    </el-card>
    <test></test>
    <Menu/>
  </div>
</template>
<script>
import Menu from '@/components/menu.vue';
import centreTable from "@/components/centreTable.vue";
import test from "@/components/test.vue"
import { getTableDatas } from "@/api/configHttp";
export default {
  id: "easyroadShows",
  components: { centreTable,test,Menu },
  props: {},
  data() {
    return {
      tableData: [],
      inverterMonTimer: null, //设置定时刷新，五分钟一次
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {
    this.inverterMonTimer = setInterval(() => {
      this.getTableData();
    }, 1000);
  },
  beforeDestroy() {
    clearInterval(this.inverterMonTimer);
    this.inverterMonTimer = null;
  },
  methods: {
    getTableData() {
      getTableDatas()
        .then((res) => {
          this.tableData = res;
          console.log(this.tableData,'this.tableData');
          
        })
        .catch(() => {
          
        });
    },
    handle(val, row) {
      console.log(val, "操作", row);
    },
  },
};
</script>

<style lang="less" scoped>
.ms-nav {
  width: 100%;
}
.indexpage {
  width: 100%;
}
.box-card {
  width: 100%;
  height: 100%;
}
.clearfix {
  width: 100%;
  height: 100%;
}
</style>
